package org.groupg.practice;

import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
import net.sf.jsqlparser.statement.insert.Insert;

public class InsertParser {
    public static void main(String[] args) throws JSQLParserException {
        String sql = "INSERT INTO users (id, name, email) VALUES (101, 'Alice', 'alice@example.com')";

        Insert insert = (Insert) CCJSqlParserUtil.parse(sql);

        System.out.println("目标表: " + insert.getTable().getName());
        System.out.println("插入列: " + insert.getColumns());
        System.out.println("插入值: " + insert.getValues().getExpressions());
    }
}